<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    
    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
      <a-button type="primary" icon="download" @click="handleExportXls('YGDAB')">导出</a-button>
      <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
        <a-button type="primary" icon="import">导入</a-button>
      </a-upload>
      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>删除</a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作 <a-icon type="down" /></a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        class="j-table-force-nowrap"
        @change="handleTableChange">

        <template slot="htmlSlot" slot-scope="text">
          <div v-html="text"></div>
        </template>
        <template slot="imgSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
          <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/>
        </template>
        <template slot="fileSlot" slot-scope="text">
          <span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
          <a-button
            v-else
            :ghost="true"
            type="primary"
            icon="download"
            size="small"
            @click="uploadFile(text)">
            下载
          </a-button>
        </template>

        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">编辑</a>

          <a-divider type="vertical" />
          <a-dropdown>
            <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
            <a-menu slot="overlay">
              <a-menu-item>
                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm>
              </a-menu-item>
            </a-menu>
          </a-dropdown>
        </span>

      </a-table>
    </div>

    <ygdab-modal ref="modalForm" @ok="modalFormOk"></ygdab-modal>
  </a-card>
</template>

<script>

  import '@/assets/less/TableExpand.less'
  import { mixinDevice } from '@/utils/mixin'
  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import YgdabModal from './modules/YgdabModal'

  export default {
    name: "YgdabList",
    mixins:[JeecgListMixin, mixinDevice],
    components: {
      YgdabModal
    },
    data () {
      return {
        description: 'YGDAB管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'name',
            align:"center",
            dataIndex: 'name'
          },
          {
            title:'borth',
            align:"center",
            dataIndex: 'borth'
          },
          {
            title:'sex',
            align:"center",
            dataIndex: 'sex'
          },
          {
            title:'mzcode',
            align:"center",
            dataIndex: 'mzcode'
          },
          {
            title:'sfzh',
            align:"center",
            dataIndex: 'sfzh'
          },
          {
            title:'hyqk',
            align:"center",
            dataIndex: 'hyqk'
          },
          {
            title:'hjdz',
            align:"center",
            dataIndex: 'hjdz'
          },
          {
            title:'jtdz',
            align:"center",
            dataIndex: 'jtdz'
          },
          {
            title:'zzmm',
            align:"center",
            dataIndex: 'zzmm'
          },
          {
            title:'xl1',
            align:"center",
            dataIndex: 'xl1'
          },
          {
            title:'zy1',
            align:"center",
            dataIndex: 'zy1'
          },
          {
            title:'bysj1',
            align:"center",
            dataIndex: 'bysj1'
          },
          {
            title:'byyx1',
            align:"center",
            dataIndex: 'byyx1'
          },
          {
            title:'xl2',
            align:"center",
            dataIndex: 'xl2'
          },
          {
            title:'zy2',
            align:"center",
            dataIndex: 'zy2'
          },
          {
            title:'bysj2',
            align:"center",
            dataIndex: 'bysj2'
          },
          {
            title:'byyx2',
            align:"center",
            dataIndex: 'byyx2'
          },
          {
            title:'zj',
            align:"center",
            dataIndex: 'zj'
          },
          {
            title:'jstc',
            align:"center",
            dataIndex: 'jstc'
          },
          {
            title:'zc',
            align:"center",
            dataIndex: 'zc'
          },
          {
            title:'phone1',
            align:"center",
            dataIndex: 'phone1'
          },
          {
            title:'phone2',
            align:"center",
            dataIndex: 'phone2'
          },
          {
            title:'isnmg',
            align:"center",
            dataIndex: 'isnmg'
          },
          {
            title:'jyyx',
            align:"center",
            dataIndex: 'jyyx'
          },
          {
            title:'qzyq',
            align:"center",
            dataIndex: 'qzyq'
          },
          {
            title:'topdwid',
            align:"center",
            dataIndex: 'topdwid'
          },
          {
            title:'dwid',
            align:"center",
            dataIndex: 'dwid'
          },
          {
            title:'dwname',
            align:"center",
            dataIndex: 'dwname'
          },
          {
            title:'ksname',
            align:"center",
            dataIndex: 'ksname'
          },
          {
            title:'bmname',
            align:"center",
            dataIndex: 'bmname'
          },
          {
            title:'workaddr',
            align:"center",
            dataIndex: 'workaddr'
          },
          {
            title:'gwid',
            align:"center",
            dataIndex: 'gwid'
          },
          {
            title:'gwname',
            align:"center",
            dataIndex: 'gwname'
          },
          {
            title:'gzfs',
            align:"center",
            dataIndex: 'gzfs'
          },
          {
            title:'gwlb',
            align:"center",
            dataIndex: 'gwlb'
          },
          {
            title:'zwgz',
            align:"center",
            dataIndex: 'zwgz'
          },
          {
            title:'paysmonth',
            align:"center",
            dataIndex: 'paysmonth'
          },
          {
            title:'daysmonth',
            align:"center",
            dataIndex: 'daysmonth'
          },
          {
            title:'workstate',
            align:"center",
            dataIndex: 'workstate'
          },
          {
            title:'ygstdt',
            align:"center",
            dataIndex: 'ygstdt'
          },
          {
            title:'ygeddt',
            align:"center",
            dataIndex: 'ygeddt'
          },
          {
            title:'ygly',
            align:"center",
            dataIndex: 'ygly'
          },
          {
            title:'htno',
            align:"center",
            dataIndex: 'htno'
          },
          {
            title:'htlb',
            align:"center",
            dataIndex: 'htlb'
          },
          {
            title:'htstdt',
            align:"center",
            dataIndex: 'htstdt'
          },
          {
            title:'htenddt',
            align:"center",
            dataIndex: 'htenddt'
          },
          {
            title:'islw',
            align:"center",
            dataIndex: 'islw'
          },
          {
            title:'lwgsname',
            align:"center",
            dataIndex: 'lwgsname'
          },
          {
            title:'paymonth',
            align:"center",
            dataIndex: 'paymonth'
          },
          {
            title:'payzh',
            align:"center",
            dataIndex: 'payzh'
          },
          {
            title:'baseShebao1',
            align:"center",
            dataIndex: 'baseShebao1'
          },
          {
            title:'baseShebao',
            align:"center",
            dataIndex: 'baseShebao'
          },
          {
            title:'noShebao',
            align:"center",
            dataIndex: 'noShebao'
          },
          {
            title:'payShebao',
            align:"center",
            dataIndex: 'payShebao'
          },
          {
            title:'memoShebao',
            align:"center",
            dataIndex: 'memoShebao'
          },
          {
            title:'baseShiye',
            align:"center",
            dataIndex: 'baseShiye'
          },
          {
            title:'noShiye',
            align:"center",
            dataIndex: 'noShiye'
          },
          {
            title:'payShiye',
            align:"center",
            dataIndex: 'payShiye'
          },
          {
            title:'memoShiye',
            align:"center",
            dataIndex: 'memoShiye'
          },
          {
            title:'baseYiliao',
            align:"center",
            dataIndex: 'baseYiliao'
          },
          {
            title:'noYiliao',
            align:"center",
            dataIndex: 'noYiliao'
          },
          {
            title:'payYiliao',
            align:"center",
            dataIndex: 'payYiliao'
          },
          {
            title:'memoYiliao',
            align:"center",
            dataIndex: 'memoYiliao'
          },
          {
            title:'baseGongshang',
            align:"center",
            dataIndex: 'baseGongshang'
          },
          {
            title:'noGongshang',
            align:"center",
            dataIndex: 'noGongshang'
          },
          {
            title:'payGongshang',
            align:"center",
            dataIndex: 'payGongshang'
          },
          {
            title:'memoGongshang',
            align:"center",
            dataIndex: 'memoGongshang'
          },
          {
            title:'baseShengyu',
            align:"center",
            dataIndex: 'baseShengyu'
          },
          {
            title:'noShengyu',
            align:"center",
            dataIndex: 'noShengyu'
          },
          {
            title:'payShengyu',
            align:"center",
            dataIndex: 'payShengyu'
          },
          {
            title:'memoShengyu',
            align:"center",
            dataIndex: 'memoShengyu'
          },
          {
            title:'baseGjj',
            align:"center",
            dataIndex: 'baseGjj'
          },
          {
            title:'noGjj',
            align:"center",
            dataIndex: 'noGjj'
          },
          {
            title:'payGjj',
            align:"center",
            dataIndex: 'payGjj'
          },
          {
            title:'memoGjj',
            align:"center",
            dataIndex: 'memoGjj'
          },
          {
            title:'dano',
            align:"center",
            dataIndex: 'dano'
          },
          {
            title:'dasname',
            align:"center",
            dataIndex: 'dasname'
          },
          {
            title:'dagname',
            align:"center",
            dataIndex: 'dagname'
          },
          {
            title:'darowindx',
            align:"center",
            dataIndex: 'darowindx'
          },
          {
            title:'dacolindx',
            align:"center",
            dataIndex: 'dacolindx'
          },
          {
            title:'dastate',
            align:"center",
            dataIndex: 'dastate'
          },
          {
            title:'dastdt',
            align:"center",
            dataIndex: 'dastdt'
          },
          {
            title:'daeddt',
            align:"center",
            dataIndex: 'daeddt'
          },
          {
            title:'damemo1',
            align:"center",
            dataIndex: 'damemo1'
          },
          {
            title:'sfzfileurl',
            align:"center",
            dataIndex: 'sfzfileurl'
          },
          {
            title:'filename1',
            align:"center",
            dataIndex: 'filename1'
          },
          {
            title:'filename2',
            align:"center",
            dataIndex: 'filename2'
          },
          {
            title:'filename3',
            align:"center",
            dataIndex: 'filename3'
          },
          {
            title:'filename4',
            align:"center",
            dataIndex: 'filename4'
          },
          {
            title:'filename5',
            align:"center",
            dataIndex: 'filename5'
          },
          {
            title:'filename6',
            align:"center",
            dataIndex: 'filename6'
          },
          {
            title:'fileurl1',
            align:"center",
            dataIndex: 'fileurl1'
          },
          {
            title:'fileurl2',
            align:"center",
            dataIndex: 'fileurl2'
          },
          {
            title:'fileurl3',
            align:"center",
            dataIndex: 'fileurl3'
          },
          {
            title:'fileurl4',
            align:"center",
            dataIndex: 'fileurl4'
          },
          {
            title:'fileurl5',
            align:"center",
            dataIndex: 'fileurl5'
          },
          {
            title:'fileurl6',
            align:"center",
            dataIndex: 'fileurl6'
          },
          {
            title:'memo1',
            align:"center",
            dataIndex: 'memo1'
          },
          {
            title:'memo2',
            align:"center",
            dataIndex: 'memo2'
          },
          {
            title:'zjgsid',
            align:"center",
            dataIndex: 'zjgsid'
          },
          {
            title:'optype',
            align:"center",
            dataIndex: 'optype'
          },
          {
            title:'opname',
            align:"center",
            dataIndex: 'opname'
          },
          {
            title:'opip',
            align:"center",
            dataIndex: 'opip'
          },
          {
            title:'optime',
            align:"center",
            dataIndex: 'optime'
          },
          {
            title:'isdjShebao',
            align:"center",
            dataIndex: 'isdjShebao'
          },
          {
            title:'rateShebao',
            align:"center",
            dataIndex: 'rateShebao'
          },
          {
            title:'endtmShebao',
            align:"center",
            dataIndex: 'endtmShebao'
          },
          {
            title:'cbdwShebao',
            align:"center",
            dataIndex: 'cbdwShebao'
          },
          {
            title:'isdjShiye',
            align:"center",
            dataIndex: 'isdjShiye'
          },
          {
            title:'rateShiye',
            align:"center",
            dataIndex: 'rateShiye'
          },
          {
            title:'endtmShiye',
            align:"center",
            dataIndex: 'endtmShiye'
          },
          {
            title:'cbdwShiye',
            align:"center",
            dataIndex: 'cbdwShiye'
          },
          {
            title:'isdjYiliao',
            align:"center",
            dataIndex: 'isdjYiliao'
          },
          {
            title:'rateYiliao',
            align:"center",
            dataIndex: 'rateYiliao'
          },
          {
            title:'endtmYiliao',
            align:"center",
            dataIndex: 'endtmYiliao'
          },
          {
            title:'cbdwYiliao',
            align:"center",
            dataIndex: 'cbdwYiliao'
          },
          {
            title:'isdjGongshang',
            align:"center",
            dataIndex: 'isdjGongshang'
          },
          {
            title:'rateGongshang',
            align:"center",
            dataIndex: 'rateGongshang'
          },
          {
            title:'endtmGongshang',
            align:"center",
            dataIndex: 'endtmGongshang'
          },
          {
            title:'cbdwGongshang',
            align:"center",
            dataIndex: 'cbdwGongshang'
          },
          {
            title:'isdjShengyu',
            align:"center",
            dataIndex: 'isdjShengyu'
          },
          {
            title:'rateShengyu',
            align:"center",
            dataIndex: 'rateShengyu'
          },
          {
            title:'endtmShengyu',
            align:"center",
            dataIndex: 'endtmShengyu'
          },
          {
            title:'cbdwShengyu',
            align:"center",
            dataIndex: 'cbdwShengyu'
          },
          {
            title:'isdjGjj',
            align:"center",
            dataIndex: 'isdjGjj'
          },
          {
            title:'rateGjj',
            align:"center",
            dataIndex: 'rateGjj'
          },
          {
            title:'endtmGjj',
            align:"center",
            dataIndex: 'endtmGjj'
          },
          {
            title:'cbdwGjj',
            align:"center",
            dataIndex: 'cbdwGjj'
          },
          {
            title:'isdjJzjf',
            align:"center",
            dataIndex: 'isdjJzjf'
          },
          {
            title:'jfjeJzjf',
            align:"center",
            dataIndex: 'jfjeJzjf'
          },
          {
            title:'jfjeEgs',
            align:"center",
            dataIndex: 'jfjeEgs'
          },
          {
            title:'jfjePaewx',
            align:"center",
            dataIndex: 'jfjePaewx'
          },
          {
            title:'isldjba',
            align:"center",
            dataIndex: 'isldjba'
          },
          {
            title:'ldjbayy',
            align:"center",
            dataIndex: 'ldjbayy'
          },
          {
            title:'isdjShebaogr',
            align:"center",
            dataIndex: 'isdjShebaogr'
          },
          {
            title:'rateShebaogr',
            align:"center",
            dataIndex: 'rateShebaogr'
          },
          {
            title:'baseShebaogr',
            align:"center",
            dataIndex: 'baseShebaogr'
          },
          {
            title:'isdjShiyegr',
            align:"center",
            dataIndex: 'isdjShiyegr'
          },
          {
            title:'rateShiyegr',
            align:"center",
            dataIndex: 'rateShiyegr'
          },
          {
            title:'baseShiyegr',
            align:"center",
            dataIndex: 'baseShiyegr'
          },
          {
            title:'isdjYiliaogr',
            align:"center",
            dataIndex: 'isdjYiliaogr'
          },
          {
            title:'rateYiliaogr',
            align:"center",
            dataIndex: 'rateYiliaogr'
          },
          {
            title:'baseYiliaogr',
            align:"center",
            dataIndex: 'baseYiliaogr'
          },
          {
            title:'isdjGjjgr',
            align:"center",
            dataIndex: 'isdjGjjgr'
          },
          {
            title:'rateGjjgr',
            align:"center",
            dataIndex: 'rateGjjgr'
          },
          {
            title:'baseGjjgr',
            align:"center",
            dataIndex: 'baseGjjgr'
          },
          {
            title:'dbbe',
            align:"center",
            dataIndex: 'dbbe'
          },
          {
            title:'isdjShengy',
            align:"center",
            dataIndex: 'isdjShengy'
          },
          {
            title:'ygkqaqj',
            align:"center",
            dataIndex: 'ygkqaqj'
          },
          {
            title:'ygkqgwj',
            align:"center",
            dataIndex: 'ygkqgwj'
          },
          {
            title:'ygkqjxj',
            align:"center",
            dataIndex: 'ygkqjxj'
          },
          {
            title:'yggwjt',
            align:"center",
            dataIndex: 'yggwjt'
          },
          {
            title:'hgfilename1',
            align:"center",
            dataIndex: 'hgfilename1'
          },
          {
            title:'hgfilename2',
            align:"center",
            dataIndex: 'hgfilename2'
          },
          {
            title:'hgfilename3',
            align:"center",
            dataIndex: 'hgfilename3'
          },
          {
            title:'hgfilename4',
            align:"center",
            dataIndex: 'hgfilename4'
          },
          {
            title:'hgfileurl1',
            align:"center",
            dataIndex: 'hgfileurl1'
          },
          {
            title:'hgfileurl2',
            align:"center",
            dataIndex: 'hgfileurl2'
          },
          {
            title:'hgfileurl3',
            align:"center",
            dataIndex: 'hgfileurl3'
          },
          {
            title:'hgfileurl4',
            align:"center",
            dataIndex: 'hgfileurl4'
          },
          {
            title:'chkflag',
            align:"center",
            dataIndex: 'chkflag'
          },
          {
            title:'chkmemo1',
            align:"center",
            dataIndex: 'chkmemo1'
          },
          {
            title:'chkoper1',
            align:"center",
            dataIndex: 'chkoper1'
          },
          {
            title:'chktime1',
            align:"center",
            dataIndex: 'chktime1'
          },
          {
            title:'chkip1',
            align:"center",
            dataIndex: 'chkip1'
          },
          {
            title:'chkmemo2',
            align:"center",
            dataIndex: 'chkmemo2'
          },
          {
            title:'chkoper2',
            align:"center",
            dataIndex: 'chkoper2'
          },
          {
            title:'chktime2',
            align:"center",
            dataIndex: 'chktime2'
          },
          {
            title:'chkip2',
            align:"center",
            dataIndex: 'chkip2'
          },
          {
            title:'chkmemo3',
            align:"center",
            dataIndex: 'chkmemo3'
          },
          {
            title:'chkoper3',
            align:"center",
            dataIndex: 'chkoper3'
          },
          {
            title:'chktime3',
            align:"center",
            dataIndex: 'chktime3'
          },
          {
            title:'chkip3',
            align:"center",
            dataIndex: 'chkip3'
          },
          {
            title:'chkmemo4',
            align:"center",
            dataIndex: 'chkmemo4'
          },
          {
            title:'chkoper4',
            align:"center",
            dataIndex: 'chkoper4'
          },
          {
            title:'chktime4',
            align:"center",
            dataIndex: 'chktime4'
          },
          {
            title:'chkip4',
            align:"center",
            dataIndex: 'chkip4'
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            // fixed:"right",
            width:147,
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/bj/ygdab/list",
          delete: "/bj/ygdab/delete",
          deleteBatch: "/bj/ygdab/deleteBatch",
          exportXlsUrl: "/bj/ygdab/exportXls",
          importExcelUrl: "bj/ygdab/importExcel",
        },
        dictOptions:{},
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      },
    },
    methods: {
      initDictConfig(){
      }
    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less';
</style>